<?php
    $start = $_POST['start'];
    $end = $_POST['end'];
    $con = mysqli_connect('localhost','root','123456','goodslist');
    $sql="SELECT * FROM `goods` LIMIT $start,$end";

    $res = mysqli_query($con,$sql);
    if(!$res){
        die('error' . mysqli_error($con));
    }

    $arr=array();
    $row = mysqli_fetch_assoc($res);
    while($row){
        array_push($arr,$row);
        $row = mysqli_fetch_assoc($res);
    }

    echo json_encode(array("code"=>1,"length"=>12,"list"=>$arr),JSON_UNESCAPED_UNICODE);

?>